Skip to content

Update VelocityUtil.java (Round instead of truncating in toLegacyVelocity)#1272

Merged
kennytv merged 1 commit into
ViaVersion:masterfrom
Term4:master
Jun 12, 2026
Merged

Update VelocityUtil.java (Round instead of truncating in toLegacyVelocity)#1272
kennytv merged 1 commit into
ViaVersion:masterfrom
Term4:master

Conversation

@Term4

@Term4 Term4 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

toLegacyVelocity truncates ((long) (value * 8000)), which drops a short when converting velocity from 1.21.9+'s lossy LOW_PRECISION_VECTOR: a clean 0.4 b/t decodes as 0.39998779, so 3199.9 floors to 3199 instead of 3200. Rounding recovers the correct legacy short.

@kennytv kennytv merged commit 33d3b1d into ViaVersion:master Jun 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants